package io.github.wslxm.springbootplus2.manage.sys.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.github.wslxm.springbootplus2.core.base.service.impl.BaseServiceImpl;
import io.github.wslxm.springbootplus2.core.enums.BaseDic;
import io.github.wslxm.springbootplus2.manage.sys.dao.SysMenuDao;
import io.github.wslxm.springbootplus2.manage.sys.mapper.SysMenuMapper;
import io.github.wslxm.springbootplus2.manage.sys.model.entity.SysMenu;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wangsong
 */
@Service
public class SysMenuDaoImpl extends BaseServiceImpl<SysMenuMapper, SysMenu> implements SysMenuDao {

    @Override
    public List<SysMenu> findMenus() {
        return this.list(new LambdaQueryWrapper<SysMenu>()
                .orderByAsc(SysMenu::getSort)
                .orderByAsc(SysMenu::getCreateTime)
                .eq(SysMenu::getDisable, BaseDic.Whether.V0));
    }
}